@extends('home.layout.base')
<link rel="stylesheet" href="{{URL::asset('./css/hrmy/public.css')}}">
<link rel="stylesheet" href="{{URL::asset('./css/hrmy/index.css')}}">

@section('content')
<div class="mainHrContent" id="hrFootprint">
    <div class="storelistTitle">
        <span class="storelistTitle_left">
            <span>
                <img src="{{URL::asset('./img/icon/home.png')}}">
            </span>
            <span><a href="{{route('home.index.index') }}">首页</a> >
                <a href="{{route('home.hrmy.hrIndex') }}">用户中心</a>
                > 浏览记录
            </span>
        </span>
        <span class="storelistTitle_right">
            <span>找不到合适的供应商？发个需求试试？</span>
            <button @click=" window.location.href = '{{ route('home.demand.demandAdd') }}'">免费发布需求</button>
        </span>
    </div>
    <div class="hrContent">
        @include('home.hrmy.menu')
        <div class="basicInfo" id="hrFootprints">
            <div class="basicInfo_title" style="margin-bottom:0px">
                <span></span>
                浏览记录
            </div>
            <div class="footprintMian" v-for="(item,index) in listData">
                <!-- 供应商 -->
                <div class="footprint_store" v-if="item.type==1">
                    <img :src="item.store.logo">
                    <div>
                        <p class="footprint_title">
                            <span class="footprint_name">@{{item.store.store_name}}
                                <img v-if="item.store.quality==2" src="{{URL::asset('./img/icon/storeColloct.png')}}">
                                <img v-if="item.store.hot==2" src="{{URL::asset('./img/icon/storeHot.png')}}">
                            </span>
                            <span class="browseTime"> 浏览于<span>
                                    @{{item.created_at}}
                                </span></span>
                        </p>
                        <p class="footprint_1">
                            <span style="color:#333333">
                                <img src="{{URL::asset('./img/icon/storeListTel.png')}}">
                                @{{item.store.call}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/storeListNote.png')}}">
                                @{{item.store.service}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                @{{item.store.view}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/storeListZan.png')}}">
                                @{{item.store.praise}}
                            </span>
                        </p>
                        <p>
                            @{{item.store.service_scope}} </p>
                    </div>
                    <button @click=" window.location.href = '{{ route('home.store.store') }}?id='+item.store.id">
                        查看详情
                    </button>
                </div>
                <!-- 产品 -->
                <div class="footprint_goods" v-if="item.type==3">
                    <img :src="item.goods.thumb">
                    <div>
                        <p class="footprint_title">
                            <span class="footprint_name">@{{item.goods.title}}
                            </span>
                            <span class="browseTime"> 浏览于<span>
                                    @{{item.created_at}}
                                </span></span>
                        </p>
                        <p class="footprint_goodsMes">
                            @{{item.goods.description}}
                        </p>
                        <p class="footprint_goodsFooter">
                            <span>
                                <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                @{{item.goods.salenum}}
                            </span>
                            <a>
                                ￥
                                <span>
                                    @{{item.goods.price}}
                                </span>
                            </a>
                        </p>
                    </div>
                    <button @click=" window.location.href = '{{ route('home.goods.goodsDetails') }}?goodsId='+item.goods.id+'&type='+item.goods.type">
                        查看详情
                    </button>
                </div>
                <!-- 活动 -->
                <div class="footprint_activity" v-if="item.type==4">
                    <img :src="item.act.thumb">
                    <div>
                        <p class="footprint_title">
                            <span class="footprint_name">@{{item.act.title}}
                            </span>
                            <span class="browseTime"> 浏览于<span>
                                    @{{item.created_at}}
                                </span></span>
                        </p>
                        <p class="footprint_activityMes">
                            <span>
                                <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                @{{item.act.view}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/child.png')}}">
                                @{{item.act.number}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/monyred.png')}}">
                                @{{item.act.cost}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/timeyellow.png')}}">
                                @{{item.act.start_at}}
                            </span>
                        </p>
                    </div>
                    <button @click=" window.location.href = '{{ route('home.activity.actDetails') }}?cateId='+item.act.id">
                        查看详情
                    </button>
                </div>
                <!-- 文档 -->
                <div class="footprint_word" v-if="item.type==5">
                    <img :src="item.word.thumb">
                    <div>
                        <p class="footprint_title">
                            <span class="footprint_name">@{{item.word.title}}
                            </span>
                            <span class="browseTime"> 浏览于<span>
                                    @{{item.created_at}}
                                </span></span>
                        </p>
                        <p class="footprint_wordMes footprint_activityMes">
                            <span>
                                <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                @{{item.word.view}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/download.png')}}">
                                @{{item.word.download}}
                            </span>
                            <span>
                                <img src="{{URL::asset('./img/icon/time.png')}}">
                                @{{item.word.created_at}}
                            </span>
                            <span>
                                <img v-if="item.word.format=='doc' || item.word.format=='docx'" src="{{URL::asset('./img/icon/downWord.png')}}">
                                <img v-if="item.word.format=='ppt'" src="{{URL::asset('./img/icon/downPPT.png')}}">
                                <img v-if="item.word.format=='pdf'" src="{{URL::asset('./img/icon/downPdf.png')}}">
                                <img v-if="item.word.format=='xlsx' || item.word.format=='xls'" src="{{URL::asset('./img/icon/downExel.png')}}">
                            </span>
                        </p>
                    </div>
                    <button @click=" window.location.href = '{{ route('home.word.wordDetails') }}'">
                        查看详情
                    </button>
                </div>
                <!-- 需求 -->
                <div class="footprint_demand" v-if="item.type==2">
                    <span class="itemMone">
                        <a>
                            ￥
                        </a>@{{item.demand.price}}万
                    </span>
                    <div>
                        <p class="footprint_title">
                            <span class="footprint_name">@{{item.demand.title}}
                                <img src="{{URL::asset('./img/icon/urgent.png')}}">
                            </span>
                            <span class="browseTime"> 浏览于<span>
                                    @{{item.created_at}}
                                </span></span>
                        </p>
                        <p>@{{item.demand.content}}</p>
                        <p class="footprint_demandFooter">
                            <span>
                                <a>
                                    @{{item.demand.number}}
                                </a>
                                竞标

                            </span>
                            <span>
                                <a>
                                    @{{item.demand.created_at}}
                                </a>
                                发布
                            </span>
                            <span>
                                <a>
                                    @{{item.demand.end_at}}
                                </a>
                                后截止
                            </span>
                        </p>
                    </div>
                    <button @click=" window.location.href = '{{ route('home.demand.demandHRDetails') }}?demandId='+item.demand.id">
                        查看详情
                    </button>
                </div>
            </div>

            <div class="elementPage" style="margin-top: 20px;" v-if="pageCount>0">
                <el-pagination :pager-count="5" @current-change="handleCurrentChange" :current-page.sync="pageNumber" background prev-text="上一页" next-text="下一页" layout="prev, pager, next,jumper" :total="pageCount">
                </el-pagination>
            </div>
        </div>
    </div>
</div>
<style>
    .footprint_wordMes.footprint_activityMes {
        display: grid;
        grid-template-columns: 108px 108px 200px 50px;
        grid-column-gap: 10px;
    }

    .footprintMian>div:last-child {
        border-bottom: 1px solid rgba(204, 204, 204, 1);
    }
</style>
@endsection
@section('compontentScipts')
<script>
    $(() => {
        let hrFootprint = new Vue({
            el: '#hrFootprints',
            data: () => {
                return {
                    pageNumber: 1,
                    pageCount: 0,
                    listData: []
                }
            },
            created() {
                this.getList();
            },
            mounted() {},
            methods: {
                getList() {
                    let data = {
                        page: this.pageNumber
                    }
                    apiAjax("{{ route('home.user.userFootprintApi')}}", 'get', data, (res) => {
                        if (res.code == 0) {
                            this.pageCount = res.data.total;
                            this.listData = res.data.data;

                        } else {
                            this.$message({
                                message: res.msg,
                                type: 'warning'
                            });
                        }
                    }, (erro) => {

                    });
                },
                handleCurrentChange(val) {
                    this.pageNumber = val;
                    this.getList();
                },
            }
        })
    })
</script>
@endsection